<?php

/**
 * 
 */
class Admin_Form_Auth extends Zend_Form
{
	/**
	 * (non-PHPdoc)
	 * @see Zend_Form::init()
	 */
	public function init ()
	{
		//Atributos
		$this->setMethod( Zend_Form::METHOD_POST );
		$this->setAttrib( 'id', 'login-form' );
		$this->setAttrib( 'name', 'login-form' );
		$this->setAttrib( 'class', 'form with-margin' );
		
		//Elementos
		$elements = array();
		
		$decorator = array( 'ViewHelper' );

		$elements[] = $this->createElement('text', 'email')
			->setDecorators($decorator)
			->addValidator('EmailAddress')
			->setAttrib('maxlength', 100)
			->setAttrib('class', 'full-width')
			->setRequired(true);
			
		$elements[] = $this->createElement('password', 'senha')
			->setDecorators($decorator)
			->setAttrib('maxlength', 20)
			->setAttrib('class', 'full-width')
			->addValidator('StringLength', false, array(6, 20))
			->setRequired(true);
			
		$elements[] = $this->createElement('checkbox', 'keep-logged')
			->setDecorators($decorator)
			->setAttrib('class', 'mini-switch')
			->setValue(0);
			
		$this->addElements( $elements );
	}
}